Skip to content

feat(comment-cli): default unattributed comments to the AI identity#565

Merged
yumike merged 1 commit into
mainfrom
comment-cli-default-ai-author
Jun 22, 2026
Merged

feat(comment-cli): default unattributed comments to the AI identity#565
yumike merged 1 commit into
mainfrom
comment-cli-default-ai-author

Conversation

@yumike

@yumike yumike commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

What

The rw comment CLI's primary user is an LLM agent, yet with no env var or flag configured it stamped new comments with the shared default identity { id: "local:human", name: "You" } — indistinguishable in the browser from the human reviewer's own comments.

This defaults the CLI to the viewer-recognized { id: "local:ai", name: "AI" } identity, which renders with a sparkles avatar. Env vars (RW_COMMENT_AUTHOR_ID/RW_COMMENT_AUTHOR_NAME) and --author-* flags still override.

Scope

  • Only the rw comment CLI default changes. The shared store fallback (Author::local_human()) and the rw serve browser write path stay local:human — a browser comment is from a human.
  • Author::local_ai() is added next to local_human() in rw-comments, since local:ai is already a canonical viewer identity.
  • resolve_author now returns Author (defaulting to local_ai()) instead of Result<Option<Author>>; the two call sites wrap it in Some(..). NewComment.author/CreateComment.author remain Option<Author> (HTTP deserialization relies on it).

Tests

cargo test -p rw -p rw-comments — green (resolver unit tests updated to assert the local:ai default; error-path tests unchanged).

🤖 Generated with Claude Code

The `rw comment` CLI's primary user is an LLM agent, but with no env var or
flag configured it stamped comments as the human `local:human`/"You" identity,
indistinguishable in the browser from the reviewer's own comments. Default the
CLI to the viewer-recognized `local:ai`/"AI" identity (sparkles avatar) instead;
env vars and flags still override, and the browser/`rw serve` path is unchanged.

Docs and CHANGELOG updated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@yumike yumike merged commit 709515a into main Jun 22, 2026
18 checks passed
@yumike yumike deleted the comment-cli-default-ai-author branch June 22, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant